<div style="margin:10px">
<h1>User groups management</h1>
<div>
    Danh sách nhóm | <a href="index.php?m=admin_groups&a=create">Tạo nhóm  mới</a>
</div>

<table>
   <tr>
       <th>ID</th>
       <th>Group name</th>
       <th>Group Description</th>
       <th>Action</th>
   </tr>
   <?if(count($groups)):?>
   <?foreach($groups as $g):?>
   <tr>
       <td><?=$g['group_id']?></td>
       <td><?=$g['group_name']?></td>
       <td><?=$g['group_description']?></td>
       <td><a href="index.php?m=admin_groups&a=permissions&group_id=<?=$g['group_id']?>">Set permissions</a> | 
           <a href="index.php?m=admin_groups&a=edit&group_id=<?=$g['group_id']?>">Edit</a> | 
           <a href="index.php?m=admin_groups&a=delete&group_id=<?=$g['group_id']?>"onclick="return confirm('Are you sure?')" >Delete</a></td>
   </tr>
   <?endforeach?>
   <?else:?>
   <tr><td colspan="4">No group available, please create one!</td></tr>
   <?endif?>
</table>
</div>

<script type="text/javascript">

function deleteUser(userid){

    var conf = confirm("Are you sure you want to delete this user?");
    if(conf == true){
         var url="index.php?m=admin_users&a=delete&user_id="+userid;
         window.location=url;
         //alert (url);
    }

}

</script>